-
Notifications
You must be signed in to change notification settings - Fork 3
add test for defined and reset methods in TensorTest #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds test coverage for two tensor lifecycle methods: defined() and reset(). These tests verify that tensors can be checked for initialization state and can be properly reset to an undefined state.
- Adds
Definedtest to verify that a properly initialized tensor returns true fordefined() - Adds
Resettest to verify that callingreset()makes a tensor undefined
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/TensorTest.cpp
Outdated
|
|
||
| // 测试 defined | ||
| TEST_F(TensorTest, Defined) { | ||
| // Tensor tensor(paddle_tensor_); |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commented-out code should be removed. The tensor object is already initialized in the test fixture's SetUp() method and is available to all test cases. This commented line appears to be leftover from development and is consistent with similar commented lines in other tests in this file that should also be cleaned up.
test/TensorTest.cpp
Outdated
|
|
||
| // 测试 reset | ||
| TEST_F(TensorTest, Reset) { | ||
| // Tensor tensor(paddle_tensor_); |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commented-out code should be removed. The tensor object is already initialized in the test fixture's SetUp() method and is available to all test cases. This commented line appears to be leftover from development and is consistent with similar commented lines in other tests in this file that should also be cleaned up.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
新增

reset和defined测试Paddle中SymInt是int64_t的别名,libtorch中SymInt是一个类,是否需要对齐一下SymInt,还是说以后的测试用例分别编译,只要输出相同就行